package com.zhou.essearch.document;

import io.swagger.annotations.ApiModel;
import jdk.nashorn.internal.ir.annotations.Ignore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.Mapping;

import javax.print.Doc;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @ClassName DocDocument
 * @Description
 * @Author jiangshicun@bicai365.com
 * @Date 2020/1/20 18:01
 */
@Document(indexName = "doc", type = "api")
@Mapping(mappingPath = "docIndex.json") // 解决IK分词不能使用问题
@Data
@Accessors(chain = true)
@ApiModel(value="DocDocument", description="API")
@NoArgsConstructor
@AllArgsConstructor
public class DocDocument implements Serializable {
    @Id
    private String id;

    private String projectName;
    //名称
    private String name;
    //排序
    private Integer sort;
    //类型
    private String type;
    //内容
    @Field(analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String content;
    //创建时间
    private Date createTime;
    //最后更新时间
    private Date lastUpdateTime;
    //项目id
    private String projectId;
    //
    private String parentId;

    private String description;

    private String details;

    private String requestSchema;

    private String url;
    @Ignore
    private List<Doc> children;
}
